<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="field[@type = 'datetime' and parent::doctype]" mode="dtf_error">
			<xsl:if test="../../pass_info/error[@field_name = current()/@name]">
				<xsl:choose>
					<xsl:when test="../../pass_info/error[@field_name = current()/@name and @name = 'INCORRECT_VALUE']">
						<div class="error">
							<span>Некорректное значение одного из параметров</span>
						</div>
					</xsl:when>
					<xsl:when test="../../pass_info/error[@field_name = current()/@name and @name = 'UNALLOWED_YEAR']">
						<div class="error">
							<span>Неразрешённое значение года</span>
						</div>
					</xsl:when>
					<xsl:when test="../../pass_info/error[@field_name = current()/@name and @name = 'UNALLOWED_MONTH']">
						<div class="error">
							<span>Неразрешённое значение месяца</span>
						</div>
					</xsl:when>
					<xsl:when test="../../pass_info/error[@field_name = current()/@name and @name = 'UNALLOWED_DAY']">
						<div class="error">
							<span>Неразрешённое значение дня</span>
						</div>
					</xsl:when>
				</xsl:choose>
			</xsl:if>
	</xsl:template>
</xsl:stylesheet>
